package com.drtc.service.common.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 通用mapper
 *
 * @auther zcy
 * @data 2019/10/28 17:23
 */
@Repository
public interface BaseMapper<T> extends Mapper<T>, MySqlMapper<T> {

    @Select("${sql}")
    Integer executeCountSql(@Param("sql") String sql);

    @Insert("${sql}")
    Integer executeUpdateSql(@Param("sql") String sql);

    @Select("${sql}")
    List<Map<String, Object>> executeSelectSql(@Param("sql") String sql);

    @Select("${sql}")
    List<Object> executeSql(@Param("sql") String sql);

    @Select("${sql}")
    Map<String, Object> executeSelectOneSql(@Param("sql") String sql);

    @Select("${sql}")
    ArrayList<Integer> executeSql2(@Param("sql") String sql);


}
